package com.c.ctgproject.wiget.dialog

import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle
import android.view.View
import androidx.lifecycle.Observer
import androidx.lifecycle.ViewModelProvider
import androidx.recyclerview.widget.LinearLayoutManager

import com.c.ctgproject.R
import kotlinx.android.synthetic.main.photo_choose_dialog.*


/**
 *作者:LiBW
 *创建日期: 4/2/21
 *描述:合作保险公司 Dialog
 */
class PhotoAlbumDialog(private val listener:Callback) : BaseDialogBottomFragment() {




    override fun viewIsCreated(view: View, savedInstanceState: Bundle?) {
        //拍照
        btn_takePhoto.setOnClickListener {
            listener.closeSelect(0)
            dismiss()
        }
        //相册
        btn_photoAlbum.setOnClickListener {
            listener.closeSelect(1)
            dismiss()
        }
        //关闭
        btn_cancel.setOnClickListener {
            dismiss()
        }
    }

    override fun onStart() {
        super.onStart()
        dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))

    }

    override fun getLayout() = R.layout.photo_choose_dialog

    interface Callback {
        fun closeSelect(selection:Int)

    }


}


